import Vue from 'vue'
import Router from 'vue-router'
import HomeContainer from '../components/HomeContainer'
import CategoryContainer from '../components/CategoryContainer'
import MemberContainer from '../components/MemberContainer'
import ShopcarContainer from '../components/ShopcarContainer'
import login from "../components/login";
import load from "../components/load";
import adminview from "../components/adminview";
import bookinfo from "../components/bookinfo";
import rank from "../components/rank";
import test from "../components/test";


Vue.use(Router)

export default new Router({
  routes: [ // 配置路由规则
    { path: '/', redirect: '/home' },
/*    { path: '/', redirect: '/login' },*/
    { path: '/home', component: HomeContainer ,
      children:[
        {path:'test',component:bookinfo}
      ]},
    { path: '/member/:userid', component: MemberContainer },

    { path: '/shopcar', component: ShopcarContainer },
    { path: '/payment', component:load},

    { path: '/category', component: CategoryContainer },
    { path: '/login', component: login},
    { path: '/admin',component:adminview},
    { path: '/bookinfo/:bookid',component:bookinfo},
    { path: '/rank',component:rank},
    { path: '/t',component:test},

  ],
  linkActiveClass: 'mui-active',// 覆盖默认的路由高亮的类，默认的类叫做 router-link-active
  mode:'history'
})
